public class student {
    String name;
    private int age;
    private String stuNum;

    @Override
    public String toString() {
        return "student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", stuNum='" + stuNum + '\'' +
                '}';
    }

    {
        this.age=10;
        this.stuNum="201401";
        this.name="wangwu";
        System.out.println("这是实例代码块");
    }
    public static String className="304班";

    static {
        className="303班";
        System.out.println("这是静态代码块");
    }
    public student(String name, int age, String stuNum) {
        this.name = name;
        this.age = age;
        this.stuNum = stuNum;
        System.out.println("这是构造方法");
    }

   public static void getClassName(){
        System.out.println(className);
    }





    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getStuNum() {
        return stuNum;
    }

    public void setStuNum(String stuNum) {
        this.stuNum = stuNum;
    }
    public void show(){
        System.out.println("姓名"+this.name);
        System.out.println("年龄"+this.age);
        System.out.println("学号"+this.stuNum);
        //System.out.println("班级"+this.className);
    }

}
